<?php
    include "admin_type.php";

$id=$_REQUEST['id'];
var_dump($id);

mysqli_select_db($conn,"shopping");

$sql = "delete from type where id='$id'";  //SQL模板

   $result=mysqli_query($conn,$sql);

    if (!$result){
        echo '数据删除失败！';
    }else{
        echo '数据删除成功！';
    }
    
    // mysqli_close($conn);

    include "admin_goods.php";

$name=$_REQUEST['name'];
var_dump($id);

mysqli_select_db($conn,"shopping");

$sql = "update goods set type=' ' where type='$name'";  //SQL模板

   $result=mysqli_query($conn,$sql);

    if (!$result){
        echo '数据清空失败！';
    }else{
        echo '数据清空成功！';
    }
    mysqli_close($conn);
?>
